home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / UTIL / ES 1.2 Package.sit / ES 1.2 Package / Developer’s toolkit / ESDemo.c 1.1.1 ƒ / ESDemo.h < prev    next >
Text File  |  1995-11-20  |  3KB  |  107 lines

  1. /* ---------------------------------------------------------------------------
  2. ESDemo.h
  3.     
  4.     ゥ1995 Ammon Skidmore, Skidperfect Software Inc.  All Rights Reserved.
  5. --------------------------------------------------------------------------- */
  6.  
  7. #ifndef SystemSevenOrLater
  8. #define SystemSevenOrLater 1
  9. #endif
  10.  
  11. #define rIconSuiteId        257
  12. #define rPopupMenuID        256
  13. #define rArrowPictID        256
  14. #define rMyStringsID        256
  15. #define kHelpStringIndex    1    // index of the help string
  16. #define    kTriangleWidth        9    // == width((*(**globH).myArrowPict)->picFrame);
  17. #define    kSmallIconWidth        16
  18. #define    kLargeIconWidth        32
  19.  
  20. enum
  21. {
  22.     kBeepIfPPC            = 1,
  23.     kHiliteClicks        = 3,
  24.     kCustomBalloons        = 4,
  25.     kCheckKeyDowns        = 5,
  26.     kUseLargeIcon        = 6,
  27.     kUseDragNDrop        = 8,
  28.     kDragFiles            = 9,
  29.     kDragTextClippings    = 10,
  30.     kSafeFinderQuit1    = 12,
  31.     kSafeFinderQuit2    = 13,
  32.     kCloseDown            = 15
  33. };
  34.  
  35. #define    kFinderType            'FNDR'
  36. #define    kSysCreator            'MACS'
  37.  
  38. // useful macros:
  39. #define width(rect)            ((rect).right - (rect).left)    // macro for rect width
  40. #define height(rect)        ((rect).bottom - (rect).top)    // macro for rect height
  41. #define PicFrame(what)        ((**MyGlobals.what).picFrame)    // macro for picture frame rect
  42. #define pstrcpy(dst, src)    (BlockMove((src), (dst), (src)[0] + 1))
  43.  
  44. #ifndef __ICONS__
  45. #include <Icons.h>
  46. #endif  __ICONS__
  47.  
  48. #ifndef __DRAG__
  49. #include <Drag.h>
  50. #endif  __DRAG__
  51.  
  52. #ifndef __CONTROLSTRIP__
  53. #include <ControlStrip.h>
  54. #endif  __CONTROLSTRIP__
  55.  
  56. #ifndef __EXTENSIONSSTRIP__
  57. #include "ExtensionsStrip.h"
  58. #endif  __EXTENSIONSSTRIP__
  59.  
  60. // our structures:
  61. #if PRAGMA_ALIGN_SUPPORTED
  62. #pragma options align=mac68k
  63. #endif
  64.  
  65. typedef struct
  66. {
  67.     Handle                    iconSuite;
  68.     MenuRef                    myMenuH;
  69.     Handle                    myStrings;
  70.     PicHandle                myArrowPict;
  71.     Boolean                    hasExtensionsStrip;
  72.     Boolean                    useLargeIcon;
  73.     long                    currentFeatures;
  74.     // Drag globals:
  75.     DragTrackingHandlerUPP    myTrackingUPP;
  76.     DragReceiveHandlerUPP    myReceiveUPP;
  77.     Boolean                    canAcceptDrag, hasEntered;
  78.     Boolean                    acceptFiles, acceptText;
  79.     ModuleReference            myReferenceNum;    // required only for Extensions Strip
  80.     Rect                    myBox;            // required only for Control/Desktop Strip
  81. } MyGlobals, *MyGlobalPtr, **MyGlobalHandle;
  82.  
  83. #if PRAGMA_ALIGN_SUPPORTED
  84. #pragma options align=reset
  85. #endif
  86.  
  87. // our prototypes:
  88. void sdevDraw(MyGlobalHandle myGlobals, Rect *statusRect, GrafPtr statusPort);
  89. void sdevClose(MyGlobalHandle myGlobals, WindowRef statusPort);
  90. long sdevInit(WindowRef statusPort);
  91. long sdevClick(MyGlobalHandle myGlobals, const Rect    *statusRect, WindowRef statusPort);
  92. //
  93. Boolean    HasDragMgr(void);
  94. void InstallDragHandlers(WindowRef statusPort, MyGlobalHandle myH);
  95. void RemoveDragHandlers(WindowRef statusPort, MyGlobalHandle myH);
  96. Boolean    HasExtensionsStrip(void);
  97. //
  98. OSErr FindAProcess(OSType typeToFind, OSType creatorToFind,
  99.                              ProcessSerialNumberPtr processSN,
  100.                              ProcessInfoRecPtr infoRecToFill);
  101. void QuitProcess (ProcessSerialNumber PSN, Boolean hasExtensionsStrip);
  102. void DrawMyIcon(MyGlobalHandle myGlobals, Boolean selected);
  103. pascal OSErr MyTrackingHandler(short message, WindowRef theWindow,
  104.                                     void *handlerRefCon, DragReference theDrag);
  105. pascal OSErr MyReceiveDropHandler(WindowRef theWindow, void *handlerRefCon,
  106.                                     DragReference theDrag);
  107.